/**
 *初始化editRole页面 取要修改的角色数据
 */
function initPage() {
    win.crebtn('editRole_btnCancel', '关闭', win.close);
    win.crebtn('editRole_btnSave', '保存', editRole);

    var json = {
        url:contextPath + "/server/base/selectByID.do",
        msg:"数据加载中.....",
        params:{
            "ROLE_DM": myTools.getQueryString("ROLE_DM"),
            "SQLID":"role.selectRoleBY_ID"
        },
        callback:[getRoleCallBack]
    };
    AjaxTools.ajax(json);
}
function getRoleCallBack(json) {
    myTools.bindForm("editRoleForm", json.data);
    Validator.validate(document.getElementById(("editRoleForm")), 3);
}
/**
 *修改模块
 */
function editRole() {
    if (!Validator.validate(document.getElementById(("editRoleForm")), 4))
        return false;
    var json = {
        url:contextPath + "/server/base/update.do",
        msg:"数据保存中.....",
        form:"editRoleForm",
        params:{
            "SQLID":"role.updateRole"
        },
        callback:[editRoleCallBack]
    };
    AjaxTools.ajax(json);
}
function editRoleCallBack(json) {
    var code = json.code;
    if (code == "00") {
        alert(json.data);
        window.parent.parent.getRole();
        win.close('editRole');
    } else {
        alert(json.data);
    }

}